-
Notifications
You must be signed in to change notification settings - Fork 545
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Advanced repeat rules UI #8422
base: dev-calendar
Are you sure you want to change the base?
Advanced repeat rules UI #8422
Conversation
c8134f0
to
040498f
Compare
30a7bb4
to
7aefc39
Compare
ffbc61b
to
be4c63a
Compare
be4c63a
to
e3da4ff
Compare
a0e43a2
to
4ff0a1d
Compare
cf65d58
to
7446664
Compare
d0e574b
to
945ddb4
Compare
945ddb4
to
199b04d
Compare
Selecting the time frame for rules will now render day/week/month/year correctly
Introduce WeekdaySelectorButton component
Currently, reading BYDAY Rules from an existing event works, however writing them has not been added yet.
Upon closing the editor it now passes the values to the model
WeekRepetitionSelector component still needs to be finished and hooked up to the CalendarWhenModel
Fix undefined weekdays being written on AdvancedRules
When changing the date outside of the RepitionEditor, the advanced repeat rules would still use the old weekday. Now, when changing the date, it will also change the advanced repeat rules that have been configured
cabb90a
to
03f14a6
Compare
const options: IntervalOption[] = [ | ||
{ | ||
value: 0, | ||
ariaValue: "same day", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use the translation as aria value so screen readers can announce the correct value for the options
const bydayRules = whenModel.advancedRules.filter((rule) => rule.ruleType == ByRule.BYDAY) | ||
if (bydayRules.length == 1) { | ||
const weekday: Weekday = Object.values(Weekday)[DateTime.fromJSDate(date).weekday - 1] | ||
const regex = /^-?\d/g // Regex for extracting the first digit from interval |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will fail if the user has imported an event with a ByDay rule with +2TH (RFC allows this).
Either we take care of this during import, or we adapt this regex to support the + sign
* we only specify what weekday of the month this event repeats on. (Ex.: BYDAY=2TH = Repeats on second THURSDAY of every month) | ||
* In case weekdays.length() == 0 && interval == 0, no BYDAY Rule shall be written, as the event will repeat on the same DAY every month. | ||
*/ | ||
private async createAdvancedRulesFromWeekdays(weekdays: Weekday[], interval?: number): Promise<AdvancedRepeatRule[]> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why async?
@@ -486,24 +486,122 @@ export const createCustomEndTypeOptions = (): ReadonlyArray<RadioGroupOption<End | |||
] | |||
} | |||
|
|||
export const createRepeatRuleEndTypeValues = (): SelectorItemList<EndType> => { | |||
export const weekdayToTranslation = (): Array<WeekdayToTranslation> => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can change it to an Array instead of a function. I'm not sure if it will break any rendering
options: this.repetitionOptions, | ||
noIcon: false, | ||
expanded: false, | ||
tabIndex: Number(TabIndex.Programmatic), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This takes the select component out of the element three, making it unreachable through tabbing
closes #8047